//
//  KATLabelBarData.m
//  KATFramework
//
//  Created by Yi Yu on 2018/3/6.
//  Copyright © 2018年 KatApp. All rights reserved.
//

#import "KATLabelBarData.h"

@implementation KATLabelBarData

+ (instancetype)data
{
    return [[[self alloc] init] autorelease];
}


//获取实例并设置文本
+ (instancetype)dataWithText:(NSString *)text
{
    KATLabelBarData *data=[self data];
    data.text=text;
    
    return data;
}


//获取实例并设置文本和数值
+ (instancetype)dataWithText:(NSString *)text andTag:(long long)tag
{
    KATLabelBarData *data=[self data];
    data.text=text;
    data.tag=tag;
    
    return data;
}


//获取实例并设置文本和消息
+ (instancetype)dataWithText:(NSString *)text andMessage:(NSString *)msg
{
    KATLabelBarData *data=[self data];
    data.text=text;
    data.message=msg;
    
    return data;
}


//初始化
- (instancetype)init
{
    self=[super init];
    
    self.type=0;
    self.num=0;
    self.tag=0;
    self.index=0;
    self.value=0.0;
    self.message=nil;
    self.url=nil;
    self.object=nil;
    self.state=0;
    self.text=nil;
    self.color=nil;
    self.style=nil;
    
    return self;
}


//描述
- (NSString *)description
{
    return [NSString stringWithFormat:@"KATLabelBarData(%i): %@",_num,_text];
}


- (void)dealloc
{
    //    NSLog(@"%@ is dealloc!",self);
    
    [_message release];
    [_object release];
    [_url release];
    [_text release];
    [_color release];
    [_style release];
    
    [super dealloc];
}

@end
